package com.d3works.apps.hr.service.lunch.voucher;

import com.d3works.apps.base.db.Company;
import com.d3works.apps.hr.db.LunchVoucherMgt;
import com.d3works.apps.hr.db.LunchVoucherMgtLine;
import com.d3works.exception.D3worksException;
import com.google.inject.persist.Transactional;
import java.io.IOException;
import java.util.List;

public interface LunchVoucherMgtService {

  @Transactional(rollbackOn = {Exception.class})
  public void calculate(LunchVoucherMgt lunchVoucherMgt) throws D3worksException;

  @Transactional(rollbackOn = {Exception.class})
  public void validate(LunchVoucherMgt lunchVoucherMgt) throws D3worksException;

  @Transactional(rollbackOn = {Exception.class})
  public int updateStock(
      List<LunchVoucherMgtLine> newLunchVoucherMgtLines,
      List<LunchVoucherMgtLine> oldLunchVoucherMgtLines,
      Company company)
      throws D3worksException;

  @Transactional(rollbackOn = {Exception.class})
  public void export(LunchVoucherMgt lunchVoucherMgt) throws IOException;

  public int checkStock(Company company, int numberToUse) throws D3worksException;

  public void calculateTotal(LunchVoucherMgt lunchVoucherMgt);
}
